import time

from commons.useful_tools import UsefulTools


def main():
    # UsefulTools().get_logs_query(30, "2024-11-13 11:00:00")
    # UsefulTools().query_bike_city(ecu_sn=ecu_sn)
    # UsefulTools().bind_bike(ecu_sn, bike_sn)
    # UsefulTools().unbind_bike(ecu_sn)
    # UsefulTools().change_bike_city(bike_sn, city_name)
    # UsefulTools().change_bike_storage_status(storage_status, bike_sn, ecu_sn)
    # UsefulTools().get_ota_template_list()
    # UsefulTools().get_ota_package_list()
    # UsefulTools().get_bike_info2execl(region_name, product_name, storage_status)
    # UsefulTools().send_command_to_ecu(ecu_list, command)
    UsefulTools().get_logs_query(ecu_sn, time_linetypes=20, start_time=start_time, end_time=end_time)
    # UsefulTools().create_ota_task(["8222420010020050"], "ZFZ", "4.1.0",
    #                               "固件包", "1.1.12", "1.1.10",
    #                               times=100)
    # UsefulTools().get_last_gps_info_by_ecu_list(ecu_list)
    pass


if __name__ == '__main__':
    print("开始时间:", time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()))
    ecu_sn = "8222420010020050"
    bike_sn = "809132471"
    city_name = "朝阳区"
    storage_status = "投放"
    online_status = "在线"
    region_name = "南乐县"
    product_name = "ZFZ"
    ecu_list = ["8222420010020050"]
    commands = [
        '开锁',
        '撤防（acc断电，后轮锁开启）',
        '关锁（acc断电,后轮锁关闭）',
        '打开电池锁',
        '关闭电池锁',
        '寻车铃声',
        '重启',
        '打开轮毂锁',
        '关闭轮毂锁',
        '开头盔锁',
        '关头盔锁',
        '头盔车辆开启',
        '头盔车辆关闭'
    ]
    times = 90
    start_time = "2025-01-02 10:00:00"
    end_time = "2025-01-02 20:00:00"
    # for i in range(times):
    #     for command in commands:
    #         print(f"第<{i+1}>次执行<{command}>命令")
    #         main()
    main()

    print("结束时间:", time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()))
